package mju.cxf.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import mju.cxf.dto.CommentsDTO;

import mju.cxf.entity.Comments;
import mju.cxf.mapper.CommentsMapper;
import mju.cxf.service.CommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 评论表 服务实现类
 * </p>
 *
 * @author 乐昌新
 * @since 2024-10-28
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments> implements CommentsService {

    @Override
    public boolean updateComments(Comments comments) {
        return this.updateById(comments);
    }

    @Override
    public boolean deleteComments(Integer id) {
        return this.removeById(id);
    }

    @Override
    public Page<CommentsDTO> selectComments(String name, Integer status, int current, int size) {
        Page<CommentsDTO> page = new Page<>(current, size);
        return baseMapper.selectPageVo(page,name,status);
    }
}
